
<!-- 解决方案 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :sonRouter="sonRouter"
      :qx="qx"
      :headBtn="headBtn"
      ref="databale"
    ></dxtable>
  </div>
</template>
 <script lang='ts' setup>
import dxtable from "../../../components/util/dxtable.vue";
import sort from "../../../components/util/sort.vue";
import { NSwitch } from "naive-ui";
import { dxget, dxpost, qurl } from "../../../util/index";
import { h, ref, reactive } from "vue";
const cz = qurl();
const databale = ref();
const props = defineProps({
  pup: { type: String },
});
const emit = defineEmits(["callBack"]);
const initeer = () => {
  databale.value.initDataExpose();
};
// 弹窗公用该列表
let dataJson = [
  {
    title: "id",
    key: "id",
    width: 80,
  },
  {
    title: "封面",
    width: 160,
    render(row) {
      return h("img", { src: row.fm, class: "fnhhbwerw" });
    },
  },
  {
    title: "方案标题",
    key: "title",
    search: true, // 是否在搜索栏展示
  },
  {
    title: "是否首页案例展示",
    width: "160",
    render(row) {
      let hgvse = false;
      if (row.sstj == 1) {
        hgvse = true;
      }
      return h(NSwitch, {
        "default-value": hgvse,
        "on-update:value": (e) => {
          xiugai({
            id: row.id,
            sstj: e,
          });
        },
      });
    },
  },
  {
    title: "排序",
    width: 100,
    render(row) {
      row.databaseName = "abbsolution";
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
  {
    title: "添加时间",
    key: "addTime",
    width: "200",
  },
];
let portUrl = "abb/abbsolution";
let headBtn = [];

const qx = {
  DeletePermissionID: "abbsolutionListdel", //删除
  EditPermissionIdentifier: "abbsolutionListbj", // 编辑
  NewPermissionIdentifier: "abbsolutionListxz", // 新建
  ViewPermissionID: "abbsolutionListck", // 查看
};

const sonRouter = "Edutsolution";

const xiugai = async (obj) => {
  const res = await dxpost("abb/abbsolution", obj, "PUT");
  console.log(res);
};
</script>
 <style scoped>
</style>